const sizeList = ['large', 'default', 'small'];
const acceptFileList = [
  '*',
  '.png',
  '.jpeg',
  '.jpg',
  '.bmg',
  '.gif',
  '.doc',
  '.docx',
  '.xls',
  '.xlsx',
  '.ppt',
  '.pptx',
  '.pdf',
  '.txt'
];
const legendTypeList = ['plain', 'scroll'];
const positionXList = ['top', 'bottom'];
const positionYList = ['left', 'right'];
const orientList = ['horizontal', 'vertical'];
const nameLocationList = ['start', 'center', 'end'];
const horizontalList = ['left', 'center', 'right'];
const axisTypeList = ['solid', 'dashed', 'dotted'];
const fontStyleList = ['normal', 'italic', 'oblique'];
const verticalList = ['top', 'middle', 'bottom'];
const overflowList = ['none', 'truncate', 'break', 'breakAll'];
const imageTypeList = ['png', 'jpg'];
const seriesPosList = [
  'top', 'left', 'right',
  'bottom', 'inside', 'insideLeft',
  'insideRight', 'insideTop', 'insideBottom',
  'insideTopLeft', 'insideTopRight',
  'insideBottomLeft', 'insideBottomRight',
  'start', 'insideStart', 'middle', 'insideEnd', 'end'
];
export const component = [
  {
    name: 'Row',
    align: 'top',
    alignList: ['top', 'middle', 'bottom'],
    gutter: 0,
    gutterList: [8, 16, 24, 32],
    justify: 'space-between',
    justifyList: ['start', 'end', 'center', 'space-around', 'space-between'],
    children: [],
    position: 'right',
    positionList: positionYList,
    nanoid: '',
    showExportBtn: true
  },
  {
    name: 'Cascader',
    label: '级联选择',
    field: '',
    placeholder: '请选择',
    required: false,
    size: 'default',
    sizeList,
    allowClear: false,
    showArrow: true,
    showSearch: false,
    expandTrigger: 'click',
    options: [
      {
        value: 'zhejiang',
        label: 'Zhejiang',
        children: [
          {
            value: 'hangzhou',
            label: 'Hangzhou',
            children: [
              {
                value: 'xihu',
                label: 'West Lake',
                isLeaf: true
              }
            ]
          }
        ]
      },
      {
        value: 'jiangsu',
        label: 'Jiangsu',
        isLeaf: true
      }
    ]
  },
  {
    name: 'CheckboxGroup',
    label: '复选框',
    field: '',
    required: false,
    options: [
      {
        label: 'Apple',
        value: 'Apple',
        checked: false
      },
      {
        label: 'Pear',
        value: 'Pear',
        checked: false
      },
      {
        label: 'Orange',
        value: 'Orange',
        checked: false
      }
    ]
  },
  {
    name: 'DatePicker',
    label: '时间选择',
    field: '',
    required: false,
    placeholder: '请选择时间',
    allowClear: true,
    showTime: false,
    isRange: false,
  },
  {
    name: 'Input',
    label: '输入框',
    field: '',
    placeholder: '请输入',
    required: false,
    size: 'default',
    sizeList,
  },
  {
    name: 'InputNumber',
    label: '数字输入框',
    field: '',
    placeholder: '请输入',
    required: false,
    size: 'default',
    sizeList,
    min: 0,
    max: 100
  },
  {
    name: 'RadioGroup',
    label: '单选框',
    field: '',
    required: false,
    options: [
      {
        label: 'Apple',
        value: 'Apple',
      },
      {
        label: 'Pear',
        value: 'Pear',
      },
      {
        label: 'Orange',
        value: 'Orange',
      }
    ],
  },
  {
    name: 'Select',
    label: '下拉选择',
    field: '',
    required: false,
    placeholder: '请选择',
    size: 'default',
    sizeList,
    allowClear: false,
    mode: 'default',
    modeList: ['default', 'tags', 'multiple'],
    showArrow: true,
    showSearch: false,
    maxTagCount: 3,
    options: [
      {
        label: 'Apple',
        value: 'Apple',
      },
      {
        label: 'Pear',
        value: 'Pear',
      },
      {
        label: 'Orange',
        value: 'Orange',
      }
    ]
  },
  {
    name: 'Switch',
    label: '开关',
    field: '',
    required: false,
    checkedChildren: '开',
    unCheckedChildren: '关',
    size: 'default',
    sizeList: sizeList.slice(1),
  },
  {
    name: 'TimePicker',
    label: '时间选择',
    field: '',
    required: false,
    placeholder: '请选择时间',
    showSeconds: true,
    hourStep: 1,
    minuteStep: 1,
    secondStep: 1,
  },
  {
    name: 'TreeSelect',
    label: '树形选择',
    field: '',
    required: false,
    placeholder: '请选择',
    allowClear: false,
    showSearch: false,
    checkable: false,
    size: 'default',
    sizeList: sizeList,
    maxTagCount: 3,
    options: [
      {
        title: 'parent 1',
        key: '100',
        children: [
          {
            title: 'parent 1-0',
            key: '1001',
            children: [
              { title: 'leaf 1-0-0', key: '10010', isLeaf: true },
              { title: 'leaf 1-0-1', key: '10011', isLeaf: true }
            ]
          },
          {
            title: 'parent 1-1',
            key: '1002',
            children: [{ title: 'leaf 1-1-0', key: '10020', isLeaf: true }]
          }
        ]
      }
    ]
  },
  {
    name: 'Upload',
    label: '上传',
    field: '',
    required: false,
    accept: ['*'],
    acceptFileList,
    moduleName: 'test',
    listType: 'text',
    listTypeList: ['text', 'picture', 'picture-card']
  },
  {
    name: 'Table',
    field: '',
    columns: [
      { title: '姓名', field: 'name', isSort: false,  showFilter: false, customFilter: false, filterMultiple: true },
    ],
    dataList: [],
    hasIndex: true,
    hasChecked: false,
    hasOperate: true
  },
  {
    name: 'EChart',
    field: '',
    chartName: 'bar',
    chartNameList: ['line', 'bar'],
    backgroundColor: '#ffffff',
    legend: {
      show: true,
      type: 'plain',
      left: 'center',
      right: 'auto',
      top: 'auto',
      bottom: 'auto',
      orient: 'horizontal',
      padding: 5,
      itemGap: 10,
    },
    toolbox: {
      show: false,
      orient: 'horizontal',
      itemSize: 15,
      itemGap: 8,
      left: 'right',
      right: 'auto',
      top: 'auto',
      bottom: 'auto',
      showTitle: true,
      feature: {
        saveAsImage: {
          show: true,
          type: 'png',
          name: 'test'
        },
        restore: {
          show: true
        },
        dataView: {
          show: true
        },
        dataZoom: {
          show: true
        }
      }
    },
    title: {
      show: false,
      text: '标题',
      textStyle: {
        color: '#000000',
        fontSize: 18
      },
      left: 'left',
      subtext: '副标题',
      subtextStyle: {
        color: '#000000',
        fontSize: 14,
      },
      padding: 15,
      itemGap: 10
    },
    grid: {
      show: false,
      top: 10,
      left: 10,
      right: 10,
      bottom: 10,
      containLabel: true
    },
    gridTUnit: 'px',
    gridLUnit: 'px',
    gridRUnit: 'px',
    gridBUnit: 'px',
    gridUnitList: ['%', 'px'],
    xAxis: {
      position: 'bottom',
      offset: 10,
      name: 'X轴',
      nameLocation: 'end',
      nameTextStyle: {
        color: '#ffffff',
        fontStyle: 'normal',
        fontWeight: 400,
        fontSize: 12,
        align: 'left',
        verticalAlign: 'top',
      },
      nameGap: 15,
      nameRotate: 0,
      inverse: false,
      axisLine: {
        show: false,
        lineStyle: {
          type: 'solid',
          color: '#ffffff',
        }
      },
      axisTick: {
        show: true,
        inside: false,
        interval: 'auto',
        alignWithLabel: false,
        lineStyle: {
          type: 'solid',
          color: '#ffffff',
        }
      },
      axisLabel: {
        show: true,
        inside: false,
        interval: 'auto',
        rotate: 0,
        margin: 8,
        color: '#ffffff',
        fontStyle: 'normal',
        fontWeight: 400,
        fontSize: 12,
        align: 'left',
        verticalAlign: 'top',
      },
      splitLine: {
        show: false
      }
    },
    yAxis: {
      position: 'left',
      offset: 10,
      name: 'Y轴',
      nameLocation: 'end',
      nameTextStyle: {
        color: '#ffffff',
        fontStyle: 'normal',
        fontWeight: 400,
        fontSize: 12,
        align: 'left',
        verticalAlign: 'top',
      },
      nameGap: 15,
      nameRotate: 0,
      inverse: false,
      axisLine: {
        show: false,
        lineStyle: {
          type: 'solid',
          color: '#ffffff',
        }
      },
      axisTick: {
        show: true,
        inside: false,
        interval: 'auto',
        alignWithLabel: false,
        lineStyle: {
          type: 'solid',
          color: '#ffffff',
        }
      },
      axisLabel: {
        show: true,
        inside: false,
        interval: 'auto',
        rotate: 0,
        margin: 8,
        color: '#ffffff',
        fontStyle: 'normal',
        fontWeight: 400,
        fontSize: 12,
        align: 'left',
        verticalAlign: 'top',
      },
      splitLine: {
        show: true
      },
    },
    series: {
      name: 'test',
      label: {
        show: true,
        position: 'inside',
        rotate: 0,
        color: '#ffffff',
        fontSize: 12,
      }
    },
    legendTypeList,
    positionXList,
    positionYList,
    orientList,
    nameLocationList,
    horizontalList,
    axisTypeList,
    fontStyleList,
    verticalList,
    overflowList,
    imageTypeList,
    seriesPosList,
  }
];


export const topSearchCSS = `
.search-top-title{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  .search-item{
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    .label-name{
      white-space: nowrap;
    }
    .control-item{
      margin-right: 10px;
      nz-select, input{
        width: 180px;
      }
    }
  }
  .left-box{
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    .table-top-btn{
      button{
        margin-right: 10px;
      }
    }
  }
  .right-box{
    flex: 1;
    display: flex;
    justify-content: flex-end;
    white-space: nowrap;
    .table-top-btn{
      button{
        margin-right: 10px;
        &:last-child{
          margin-right: 0;
        }
      }
    }
  }
}
`;
